import request from '@/utils/request'

export default{
  // 删除课程分类
  deleteById(id) {
    return request({
      url: `/admin/edu/subject/deleteById/${id}`,
      method: 'DELETE'
    })
  },

  // 更新课程分类
  updateById(subject) {
    return request({
      url: `/admin/edu/subject/updateById`,
      method: 'PUT',
      data: subject
    })
  },

  // 新增课程分类
  save(subject) {
    return request({
      url: `/admin/edu/subject/save`,
      method: 'POST',
      data: subject
    })
  },

  // 查询课程分类
  getById(id) {
    return request({
      url: `/admin/edu/subject/getById/${id}`,
      method: 'GET'
    })
  },

  // 查询课程列表
  getNestedSubjects() {
    return request({
      url: `/admin/edu/subject/getNestedSubjects`,
      method: 'GET'
    })
  }
}
